// components/start/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    like: {
      type:Boolean,
      value:false
    },
    count: {
      type:Number,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    img: "images/like.png",
    img_at: "images/like@dis.png"
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onLike:function(event) {
      let like = this.properties.like
      let count  = this.properties.count
  //默认false 点一下变为true
      count = like?count-1:count+1
      this.setData({
        like:!like,
        count:count
      })
      let behavior = this.properties.like?'like':'cancel'
      this.triggerEvent('like',{
        behavior:behavior
      })

    }
  }
})
